#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

export NO_PKG_MANGLE=1
DESTDIR = $(CURDIR)/debian/tmp

%:
	+dh $@ --parallel --with autotools-dev

override_dh_auto_configure:
	./configure --prefix=/usr/local/openresty/zlib

override_dh_auto_build:
	$(MAKE) CFLAGS='-O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3' \
		SFLAGS='-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3'

override_dh_usrlocal:

override_dh_install:
	dh_install
	rm -rf $(DESTDIR)/usr/local/openresty/zlib/share
	rm -f $(DESTDIR)/usr/local/openresty/zlib/lib/*.la
	rm -rf $(DESTDIR)/usr/local/openresty/zlib/lib/pkgconfig

override_dh_strip:
	dh_strip --dbg-package=openresty-zlib-dbgsym
